Release 10.1A: OpenEdge Data Management:
DataServer for Microsoft SQL Server
Query tuning with connection and startup parameters
You can control aspects of DataServer query handling not only programmatically within 4GL statements, but also through startup and connection parameter options as described in this section.
Note: Startup and connection parameters override query-tuning defaults. However, options set in theQUERY–TUNINGphrase take precedence over startup and connection parameters. For example, if you specifyNO–DEBUGfor a query within your application, specifyingqt_debug,SQLat connection time overrides the default application behavior but does not override theNO–DEBUGoption that you specified for the query. See the "Query tuning" section for more information.You override query-tuning defaults with the DataServer (
-Dsrv) connection parameter when you connect to an MS SQL Server database. The syntax is:
An alternate syntax for the
-Dsrvparameter is as follows:
Table 6–3 describes the query-tuning options that you can specify with the
-Dsrvparameter.
Table 6–3: Connection query-tuning options Option Descriptionqt_no_debugqt_debug,SQLqt_debug,EXTENDEDqt_debug,CURSORqt_debug,PERFORMANCEqt_debug,CALL_SUMMARYqt_debug,VERBOSE
Specifies whether the DataServer prints debugging information that it generates for the query to thedataserv.lgfile. The default isqt_no_debug, to supply no debugging information. To override the default, specify qt_debug,optionas follows:
- Specify
qt_debug,SQLto record the SQL sent to the ODBC driver in thedataserv.lgfile. Note that this SQL contains place holders for values which will be bound to the statement when sent to the data source.- Specify
qt_debug,EXTENDEDto print information such as cursor statistics in addition to the SQL statements executed by the DataServer.- Specify
qt_debug,CURSORto print information about the cursors that the DataServer uses for internal calls and for opening queries.- Specify
qt_debug,PERFORMANCEto print information on the amount of time that certain operations take.- Specify
qt_debug,CALL_SUMMARYto print information on cursors and timing.- Specify
qt_debug,VERBOSEto print all of the information gathered by the other qt_debug options.For more detailed descriptions of these options, see Table 6–4.qt_lookaheadqt_no_lookahead Specifies whether the DataServer uses lookahead or standard cursors. To generate efficient queries,qt_lookaheadis the default in the following cases:Specifyqt_no_lookaheadfor query behavior that is consistent with an OpenEdge database.qt_separate_connectionqt_no_separate_connection Specifies whether each cursor should use a separate connection to the MS SQL Server database. The default isqt_no_separate_connection, which provides behavior that is consistent with an OpenEdge database.Specifyqt_separate_connectionto use a separate connection. Executing cursors in separate connections can improve performance because the DataServer does not have to restart the cursors.qt_cache_size,integer Specifies the size in bytes of the cache used by lookahead cursors. A larger cache size can improve performance for queries that return a large number of records because the DataServer might need fewer SQL statements to get the results.Minimum: The DataServer always caches at least one record.Maximum: NoneDefault: 10,000 when block cursors are enabled (the default). 30,000 when block cursors are disabled.
The following example shows how to use the query-tuning options to enhance performance. The DataServer opens a separate connection to MSS (Microsoft SQL Server) for each cursor and writes an extended report on the SQL statements it executes:
OpenEdge provides a startup parameter called Server Join (
-nojoinbysqldb) that controls the defaultJOIN–BY–SQLDBbehavior. You specify this parameter in the startup command for your OpenEdge session. It overrides theJOIN–BY–SQLDBdefault so that the client evaluates and performs joins. Using this parameter might slow performance, but it provides results that are consistent with queries run against an OpenEdge database. See Chapter 2, "Initial Programming Considerations," for more information.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |